package cn.admin.configcenter.registry.service;

import cn.admin.config.common.Revision;
import cn.admin.config.common.protocol.Swizzle;
import cn.admin.configcenter.registry.common.info.ClientConnection;
import cn.admin.configcenter.registry.common.info.GroupId;

import java.util.List;
import java.util.Map;

public interface DataSource {

	void addPublisher(ClientConnection client, GroupId group, String clientId, String datumId);

	void publishData(ClientConnection client, GroupId group, String clientId, List<Swizzle> data,
                     Revision newRev);

	void addSubscriber(ClientConnection client, GroupId group, String clientId);

	List<Swizzle> getData(GroupId group) throws Exception;

	List<Swizzle> getPushData(GroupId group) throws Exception;

	Map<String,Swizzle> getDatumData(GroupId group);

	List<GroupId> allDataGroups() throws Exception;

}
